<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_user', function (Blueprint $table) {
            $table->increments('id');
            $table->string('mobile',20)->unique()->comment('手机号码');
            $table->string('password', 100)->comment('密码');
            $table->string('name', 20)->comment('真实姓名');
            $table->integer('role_id', 11)->comment('角色id');
            $table->tinyInteger('is_all_data', 4)->comment('是否全局视野');
            $table->string('city_id', 512)->default('')->comment('城市id');
            $table->string('auth', 4096)->comment('权限');
            $table->dateTime('desert_time')->comment('离职时间');
            $table->tinyInteger('is_agent')->default(0)->comment('是否代理商用户');
            $table->string('remember_token')->nullable()->comment('token');
            $table->string('note', 512)->default('')->comment('备注');
            $table->tinyInteger('status', 4)->default(1)->comment('状态1在岗2离职3辞退');
            $table->integer('admin_id')->default(0)->comment('操作人id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('admin_user');
    }
}
